﻿//将要成为弹出提示的div加上class：booui-popup-tip
function PopupTip() {
    var self = this;
    self.tipNodes = null;
    function init() {
        var tipNodes = $(".booui-popup-tip");
        if (tipNodes != null) {
            self.tipNodes = new Object();
            for (var i = 0; i < tipNodes.length; i++) {
                var node = tipNodes[i];
                $(node).css("position", "fixed");
                $(node).css("left", "50%");
                $(node).css("top", "50%");
                $(node).fadeOut(0);
                var orderIndex = $(node).attr("order-index");
                self.tipNodes[parseInt(orderIndex)] = node;
            }
        }
    }

    this.show = function (index) {
        if (self.tipNodes != null) {
            var node = self.tipNodes[index];
            $(node).fadeIn();
            setTimeout(function () {
                $(node).fadeOut();
            }, 1000);
        }
    }

    init();
}